Mention the stripping of (_F) suffixes.
authorMatthias Clasen <mclasen@redhat.com>
Mon, 26 Dec 2005 07:52:43 +0000 (07:52 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 26 Dec 2005 07:52:43 +0000 (07:52 +0000)
2005-12-26  Matthias Clasen  <mclasen@redhat.com>

* README.in: Mention the stripping of (_F) suffixes.

* gtk/gtktoolbar.c (_gtk_toolbar_elide_underscores): Strip a suffix of
the form " (_<single character>)", since this is the preferred way
for some languages to indicate accelerators.  (#323956, Yang Hong)

ChangeLog
ChangeLog.pre-2-10
README.in
gtk/gtktoolbar.c

index 9a71fbc6cddd363fe18b28232af863b2092c1b03..7523f9a64a5590d7f4433031bcbaf731ab3ea5ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-12-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * README.in: Mention the stripping of (_F) suffixes.
+
+       * gtk/gtktoolbar.c (_gtk_toolbar_elide_underscores): Strip a suffix of 
+       the form " (_<single character>)", since this is the preferred way
+       for some languages to indicate accelerators.  (#323956, Yang Hong)
+
        * gtk/gtklabel.c (gtk_label_class_init): Add a gtk-label-select-on-focus
        setting.
        (gtk_label_grab_focus): And use it here to select the contents of
index 9a71fbc6cddd363fe18b28232af863b2092c1b03..7523f9a64a5590d7f4433031bcbaf731ab3ea5ff 100644 (file)
@@ -1,5 +1,11 @@
 2005-12-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * README.in: Mention the stripping of (_F) suffixes.
+
+       * gtk/gtktoolbar.c (_gtk_toolbar_elide_underscores): Strip a suffix of 
+       the form " (_<single character>)", since this is the preferred way
+       for some languages to indicate accelerators.  (#323956, Yang Hong)
+
        * gtk/gtklabel.c (gtk_label_class_init): Add a gtk-label-select-on-focus
        setting.
        (gtk_label_grab_focus): And use it here to select the contents of
index f6904570e28c2ff81889725df15bcebe10b0a2be..8fd13afedb271c70164ab9768faf9a81539907c5 100644 (file)
--- a/README.in
+++ b/README.in
@@ -48,6 +48,10 @@ Release notes for 2.10
   reference. Details about floating references can be found in the docs:
   http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#floating-ref
 
+* Suffixes like (_F) are now stripped from labels when they are displayed
+  in toolbars. If this is not wanted, the feature can be suppressed by 
+  inserting a Unicode control character, e.g ZWNJ.
+
 Release notes
 =============
 
index a40aa3b4588e5c5ff6f8bfce776cccf198a72695..712b0e3c9ecfe2c4b68fac5898d3a34396ca5b40 100644 (file)
@@ -4876,11 +4876,13 @@ _gtk_toolbar_elide_underscores (const gchar *original)
   gchar *q, *result;
   const gchar *p;
   gboolean last_underscore;
+  gint s;
   
   if (!original)
     return NULL;
 
-  q = result = g_malloc (strlen (original) + 1);
+  s = strlen (original);
+  q = result = g_malloc (s + 1);
   last_underscore = FALSE;
   
   for (p = original; *p; p++)
@@ -4893,8 +4895,18 @@ _gtk_toolbar_elide_underscores (const gchar *original)
          *q++ = *p;
        }
     }
-  
+
   *q = '\0';
+
+  if (s > 4)
+    {
+      if (original[s - 5] == ' ' && 
+         original[s - 4] == '(' && 
+         original[s - 3] == '_' && 
+         original[s - 1] == ')')
+       q[-4] = '\0';
+    }
+
   
   return result;
 }